#include <iostream>
#include <string>

using namespace std;

int main()
{

    string s="1", t = "99";

    int len_s = s.size(), len_t = t.size();

    // 123
    // 789

    reverse(s.begin(), s.end());
    reverse(t.begin(), t.end());

    // 321
    // 987

    int i = 0, j = 0, k = 0;
    string res = "";
    while (i < len_s || j < len_t)
    {
        int num_s = 0;
        if (i < len_s)
            num_s = s[i] - '0';

        int num_t = 0;
        if (j < len_t)
            num_t = t[j] - '0';

        cout << "num_s : " << num_s << "  " << endl;
        cout << "num_t : " << num_t << "  " << endl;

        int num = num_s + num_t + k;

        if (num >= 10)
            k = 1;
        else
            k = 0;

        num %= 10;
        cout << "num : " << num << endl;
        char ch = num + 48;
        cout << "ch : " << ch << " " << endl;
        res += ch;

        i++, j++;
    }
    cout << "k : " << k << endl;
    if (k > 0)
        res += "1";

    reverse(res.begin(), res.end());

    //return res;
    cout << res << endl;
    
    return 0;
}